package com.wh.hotel.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author luweije
 */
@Getter
@AllArgsConstructor
public enum HotelSortTypeEnum {

    DISTANCE(1, "距离优先")
    ;

    private final int code;
    private final String desc;

    public static HotelSortTypeEnum parse(Integer code) {
        if (code == null) {
            return null;
        }
        for (HotelSortTypeEnum statusEnum : HotelSortTypeEnum.values()) {
            if (statusEnum.getCode() == code) {
                return statusEnum;
            }
        }
        return null;
    }
}
